home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18061 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: mail2news.demon.co.uk!j-bg.demon.co.uk
  2. From: John Sargent <jb@j-bg.demon.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: main()
  5. Date: Thu, 18 Apr 96 18:16:00 GMT
  6. Message-ID: <829851360snz@j-bg.demon.co.uk>
  7. References: <3174c0dc.7652220@news.flex.com.au> <829766541snz@j-bg.demon.co.uk> <Dq1C8B.3sC@news.hawaii.edu>
  8. Reply-To: jb@j-bg.demon.co.uk
  9. X-NNTP-Posting-Host: j-bg.demon.co.uk
  10. X-Newsreader: Demon Internet Simple News v1.29
  11. X-Mail2News-Path: j-bg.demon.co.uk
  12.  
  13. In article <Dq1C8B.3sC@news.hawaii.edu>
  14.            xea0005@co.honolulu.hi.us "Alvin Nonaka" writes:
  15.  
  16. > I believe the authors intended to say:
  17. > #include <stdio.h>
  18. > #include <stdlib.h>
  19. > void main(void)
  20. > {
  21. >           printf("Hello!\n");
  22. >           exit(0);
  23. > }
  24. > 'main' can't return. Calling 'exit' is better because the call to exit 
  25. > 'cleans up' all resource allocations (which you are supposed to handle) 
  26. > left pending in your code.
  27.  
  28. What do you mean, 'main' can't return? It can, and does; it's just that in 
  29. this instance, it doesn't return a value.
  30.  
  31.  
  32. Regards,
  33. John Sargent
  34.